﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using log4net;
using System.IO;

namespace GS.Cricket.Test.Logging
{
    class Logging
    {
        // for illustration, you should configure this somewhere else...
        private static string configFile = @"..\Logging\log4net.config";

        public static ILog GetLogger(Type type)
        {
            if (log4net.LogManager.GetCurrentLoggers().Length == 0)
            {
                // load logger config with XmlConfigurator
                log4net.Config.XmlConfigurator.Configure(new FileStream(configFile, FileMode.Open));
            }
            return LogManager.GetLogger(type);
        }
    }
}
